package com.atguigu.fruit.view;

import com.atguigu.fruit.bean.Fruit;
import com.atguigu.fruit.dao.impl.FruitDaoImpl;

import java.util.List;

/**
 * @author BruceLee
 * @create 2022-02-28 16:09
 */
public class test {
    public static void main(String[] args) {
        FruitDaoImpl fdi = new FruitDaoImpl();
//        Fruit fruit = new Fruit(0,"火龙果",12,55,"火龙果是红色的");
        Fruit fruit = new Fruit(35,"火龙果",12,80,"火龙果是红色的");
//        List<Fruit> fruitList = fdi.getFruitList();
//        fruitList.forEach(System.out::println);

//        boolean addFruit = fdi.addFruit(fruit);
//        if(addFruit){
//            System.out.println("添加成功");
//        }else {
//            System.out.println("添加失败");
//        }

//        boolean updateFruit = fdi.updateFruit(fruit);
//        if(updateFruit){
//            System.out.println("添加成功");
//        }else {
//            System.out.println("添加失败");
//        }

//        Fruit banana = fdi.getFruitByFname("香蕉");
//        System.out.println(banana);

        boolean del = fdi.delFruit("火龙果");
        if(del){
            System.out.println("删除成功");
        }else {
            System.out.println("删除失败");
        }


    }
}
